package com.atguigu.transfrom.split;

import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

public class SplitByFilterDemo {

    public static void main(String[] args) throws Exception {
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
        env.setParallelism(2);

        DataStreamSource<String> socketDS = env.socketTextStream("10.75.186.206", 9999);

        socketDS.filter(i -> Integer.parseInt(i) % 2 == 0).print("偶数流：");
        socketDS.filter(i -> Integer.parseInt(i) % 2 == 1).print("奇数流：");

        env.execute();
    }
}
